//
// Created by yinlijun on 2017/9/30.
//

#ifndef ROCKYSOCKET_WORK_DATA_H
#define ROCKYSOCKET_WORK_DATA_H

#ifdef __cplusplus
extern "C" {
#endif

typedef void *(*work_handler)(void *data, void *ctx);

typedef void (*work_data_destroy_func)(void *data, void *ctx);

struct WorkData;
typedef struct WorkData WorkData;

WorkData *work_data_create(void *data, work_handler handler, work_data_destroy_func destroy,
                           void *ctx);

void *work_data_handle(WorkData *thiz);

void work_data_destroy(WorkData *thiz);

void* work_data_get_data(WorkData* thiz);

#ifdef __cplusplus
}
#endif

#endif //ROCKYSOCKET_WORK_DATA_H
